package com.ktjiaoyu.crm.service;

import com.ktjiaoyu.crm.pojo.Right;
import com.ktjiaoyu.crm.pojo.Role;
import com.ktjiaoyu.crm.pojo.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;


import java.util.List;
import java.util.Map;

public interface RoleService {
    /**
     *角色增删查改
     * @return
     */
    public List<Role> findAllRoles();
    /**
     * 权限查询
     * @return
     */
    public List<Right> findAllRights();

    public List<Right> findRightsByRole(Role role);

    public Role saveRole(Role role);//新增或修改

    public void deleteRoleById(Long roleId);//删除

    public void deleteRole(Role role);

    public Role getRole(Long roleId);//按主键查询单条

    public Page<Role> findRole(String roleName, Pageable pageable);//按名称模糊查询并分页

    public List<Right> findRightsByRole();//根据角色查询权限
    //根据用户查询角色对象
    public Role findRoleByUsers(User user);

    public Map<String,String> loadFilterChainDefinitions();//加载动态权限，配置权限
    public void reloadFilterChainDefinitions();//重新加载动态权限，配置权限验证规则

 }
